using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LigerUi.MVC.DataModel.EntityClasses.Models.Mapping
{
    public class PhoneAttributionMap : EntityTypeConfiguration<PhoneAttribution>
    {
        public PhoneAttributionMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Number)
                .HasMaxLength(50);

            this.Property(t => t.City)
                .HasMaxLength(50);

            this.Property(t => t.CardType)
                .HasMaxLength(50);

            this.Property(t => t.AreaCode)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PhoneAttribution");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.City).HasColumnName("City");
            this.Property(t => t.CardType).HasColumnName("CardType");
            this.Property(t => t.AreaCode).HasColumnName("AreaCode");
        }
    }
}
